from flask import Flask

from commons.controller.global_exception_handler_controller import GlobalExceptionHandlerController
from travel_service.travel.controller import reimbursement_blueprint, schedule_blueprint, travel_blueprint


def create_app():
    app = Flask(__name__)

    GlobalExceptionHandlerController.register_global_exception_handlers(app)
    app.register_blueprint(reimbursement_blueprint, url_prefix='/reimbursement')
    app.register_blueprint(schedule_blueprint, url_prefix='/schedule')
    app.register_blueprint(travel_blueprint, url_prefix='/travel')

    return app
